/*
* ============================================================================
*  Name        : camengtestappview.h
*  Part of     : camengtest
*  Description : 
*  Version     : %version: 2 %
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details.
*
* You are welcome to, but not required to, contribute any modifications that
* improve stability, usability and/or feature set of the library back to
* Symbian/S60 Camera Wrapper project, as long as binary compatibility is
* retained. See https://projects.forum.nokia.com/camerawrapper for more info.
* ============================================================================
*/

#ifndef __CAMENGTESTAPPVIEW_H__
#define __CAMENGTESTAPPVIEW_H__

// INCLUDES
#include <coecntrl.h>


class CFbsBitmap;

// CLASS DECLARATION
class CCAMENGTESTAppView : public CCoeControl
    {
    public: // New methods

        /**
        * NewL.
        * Two-phased constructor.
        * Create a CCAMENGTESTAppView object, which will draw itself to aRect.
        * @param aRect The rectangle this view will be drawn to.
        * @return a pointer to the created instance of CCAMENGTESTAppView.
        */
        static CCAMENGTESTAppView* NewL( const TRect& aRect );

        /**
        * NewLC.
        * Two-phased constructor.
        * Create a CCAMENGTESTAppView object, which will draw itself
        * to aRect.
        * @param aRect Rectangle this view will be drawn to.
        * @return A pointer to the created instance of CCAMENGTESTAppView.
        */
        static CCAMENGTESTAppView* NewLC( const TRect& aRect );

        /**
        * ~CCAMENGTESTAppView
        * Virtual Destructor.
        */
        virtual ~CCAMENGTESTAppView();

       /**
        * GetText
        * @return modifiable reference to the descriptor, which stores
        *   user-given text
        */
        TDes& GetText();
        
        void SetText( const TDesC& aMsg );
        void SetText( const TDesC& aMsg, TInt aVal );
        void SetText( const TDesC& aMsg, TInt aVal1, TInt aVal2 );

    public:  // Functions from base classes

        /**
        * From CCoeControl, Draw
        * Draw this CCAMENGTESTAppView to the screen.
        * If the user has given a text, it is also printed to the center of
        * the screen.
        * @param aRect the rectangle of this view that needs updating
        */
        void Draw( const TRect& aRect ) const;
        
        void DrawViewFinderFrame( CFbsBitmap* aFrame );

        /**
        * From CoeControl, SizeChanged.
        * Called by framework when the view size is changed.
        */
        virtual void SizeChanged();

    private: // Constructors

        /**
        * ConstructL
        * 2nd phase constructor.
        * Perform the second phase construction of a
        * CCAMENGTESTAppView object.
        * @param aRect The rectangle this view will be drawn to.
        */
        void ConstructL(const TRect& aRect);

        /**
        * CCAMENGTESTAppView.
        * C++ default constructor.
        */
        CCAMENGTESTAppView();

    private:

       /**
        * font used, when printing user-given text to the screen
        */
        const CFont* iFont;

       /**
        * descriptor storing the user-given text
        */
        TBuf<64> iText;
        
        TRect iVfRect;
        CFbsBitmap* iFrame;
    };

#endif // __CAMENGTESTAPPVIEW_H__

// End of File

